Repository navigation
Conversation
Since the move to system units in #68, the service-manager discovers services by their manifest in /usr/lib/ark-os/manifests and manages them with system systemctl, so add-ons installed the old way (user units plus ~/.local/share/<name>) no longer show up on the Services page. Add examples/custom-service: a hello-ark add-on (unit, manifest, TOML config, polkit rule, and an install script) and a README covering the requirements, the manifest fields, what the config editor supports, polkit, upgrades, migrating from a user service, and troubleshooting. Link it from a new section in the main README. Closes #120 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The web UI can control any service that has a manifest, so an add-on needs no polkit rule (or sudoers entry) of its own. Remove the example's rule and the README's polkit section, and say that the manifest is what lets the web UI control the service. Also drop the caveat about the config editor stripping whitespace from strings; #122 fixes the parser. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Note - ArkOS installs all its services via debian, and they end up in a different spot due to being distributed by a debian. After installing ArkOS on my jetson, I see the following behavior from the debian: |
|
I'm at the Ardupilot dev conference and will test on hardware when I'm back. Claude found that the polkit rules could result in elevated privileges, but now Claude is refusing my security audit prompt 😂 |
|
Yea, I was a big fan of the old user services approach because nothing required root. With installing a bunch of FOSS code that's not containerized that it at least doesn't have access to everything on the system. I'm sure it can be figured out how to do it, but it will take more thought. I'll keep iterating on hardware here and can propose any changes I find. |
Summary
Closes #120.
Since #68 moved ARK-OS to system units, the service-manager finds services by their manifest in
/usr/lib/ark-os/manifests/and manages them with systemsystemctl. Add-ons set up the old way (a user unit plus~/.local/share/<name>/) no longer appear on the Services page. Until now, the new requirements weren't written down anywhere.This PR adds:
examples/custom-service/: a working add-on,hello-ark, that logs a configurable message. It has a unit, a manifest, a TOML config, and aninstall.sh(with--uninstall). The install script reads the ARK-OS user fromservice-manager.service, so the same files work on Jetson, Pi and Modalix.examples/custom-service/README.md, which covers:What an add-on needs:
User=and[Install]/etc/systemd/system/<name>.service/usr/lib/ark-os/manifests/<name>.manifest.json<ark-user>, mode 0664)/etc/ark-os/<configFile>An add-on doesn't need a polkit rule or a sudoers entry: the web UI can control any service that has a manifest.
Testing
I ran the example end to end in a Debian bookworm container with systemd, using ARK-OS's real
service-manager.serviceandservice_manager.py, with userpi:install.shinstalled the four files with the right owners and modes.GET /statuseslistedhello-arkwithconfig_file: hello-ark.toml.GET /configandPOST /configworked, and the saved values took effect after a restart./logs/streamstreamed the service's lines with the configured priority.install.shkept the config edited through the API.--uninstallremoved everything.shellcheckpasses on both scripts. This hasn't been run on real Jetson, Pi or Modalix hardware.Notes
displayNameanddescriptionaren't shown by the web UI. Each card shows the unit name. The old source-installtools/service_control.sh listwas the only thing that read those two fields, and it was removed in feat(packaging): debian package distribution for ARK-OS #68. The README says so.🤖 Generated with Claude Code